﻿using System;
using System.Web.UI;
using ITViet.Web.App_Code;

namespace ITViet.Web.MasterPages
{
  public partial class AdminDefault : MasterPage
  {
    protected void Page_Load(object sender, EventArgs e)
    {
      lblCurTime.Text = DateTime.Now.ToString("d");
      if (IsPostBack) return;
      if (((AdminBasePage)Page).CurrentUser != null)
        lblUserName.Text = ((AdminBasePage)Page).CurrentUser.Fullname + " !";
    }

    protected void hbtLogout_Click(object sender, EventArgs e)
    {
      ((AdminBasePage)Page).ClearAuthenticationTicket();
      Response.Redirect("~/Admin/Login.aspx");
    }

    protected void btnEN_Click(object sender, ImageClickEventArgs e)
    {
      ((AdminBasePage)Page).CurrentLanguage = GlobalCache.Instance.English;
      Response.Redirect(Request.RawUrl);
    }

    protected void btnVN_Click(object sender, ImageClickEventArgs e)
    {
      ((AdminBasePage)Page).CurrentLanguage = GlobalCache.Instance.Vietnamese;
      Response.Redirect(Request.RawUrl);
    }

  }
}
